package context.render.shader;

import context.util.Parser;
import org.lwjgl.opengl.GL20;

public class ShaderVert
{
    
    public static final String FILE_TYPE = ".vert";
    
    private static final Parser PARSER = new Parser();
    
    
    public int mID;
    
    
    public ShaderVert(String aFileName)
    {
        String fullPath = (
            Shader.FILE_PATH + 
            aFileName + 
            ShaderVert.FILE_TYPE
        );
        String shaderSrc = ShaderVert.PARSER.parse(fullPath);
        int id = GL20.glCreateShader(GL20.GL_VERTEX_SHADER);
        GL20.glShaderSource(id, shaderSrc);
        GL20.glCompileShader(id);
        this.mID = id;
    }
    
    
    public void onEnd()
    {
        GL20.glDeleteShader(this.mID);
    }
    
}
